package com.fc.enums;

import lombok.Getter;

@Getter
public enum ClockType implements IEnum {
    WORK(1, "上班"),
    BREAK(2, "下班");


    private final int code;
    private final String description;

    ClockType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static ClockType fromCode(int code) {
        for (ClockType status : ClockType.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("状态异常: " + code);
    }
}
